<script setup>
import { ref } from 'vue'

const count = ref(0)
onActivated(() => {
  console.log("keepalive1 activated");
});

onDeactivated(() => {
  console.log("keepalive1 deactivated");
});
</script>

<template>
  <p>Current component: A</p>
  <span>count: {{ count }}</span>
  <AButton @click="count++">+</AButton>
</template>